package com.test.common;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author wuxi
 * @create 2019/4/18 下午3:58
 *
 * sql 运算符公共类
 */
public class SqlOprate {

    public static final String EQ = "eq";

    public static final String LT = "lt";

    public static final String GT = "gt";

    public static final String LT_EQ = "lt_eq";

    public static final String GT_EQ = "gt_eq";

    public static final String IN = "in";

    public static final String OR = "or";

    public static final String AND = "and";

    public static final String LF_BRACKET = "(";

    public static final String GT_BRACKET = ")";

    public static final String EQ_OPRATE = "=";

    public static final String LT_OPRATE = "<";

    public static final String GT_OPRATE = ">";

    public static final String LT_EQ_OPRATE = "<=";

    public static final String GT_EQ_OPRATE = ">=";




    /**
     * sql 运算符
     */
    public static Map<String,String> OPRATE = new HashMap ();

    /**
     * 前端展示的字符串与数据库的映射关系
     */
    public static Map<String,String>  FIELD_MAP  = new HashMap<> ();

    static {
        OPRATE.put (EQ,EQ_OPRATE);
        OPRATE.put (LT,LT_OPRATE);
        OPRATE.put (GT,GT_OPRATE);
        OPRATE.put (LT_EQ,LT_EQ_OPRATE);
        OPRATE.put (GT_EQ,GT_EQ_OPRATE);
        OPRATE.put (IN,IN);
        OPRATE.put (OR,OR);
        OPRATE.put (AND,AND);

        FIELD_MAP.put ("id","id");
        FIELD_MAP.put ("userName","user_name");
        FIELD_MAP.put ("age","age");
        FIELD_MAP.put ("topIndex","top_index");

    }





}
